Ext.define('Intranet.LienKet.view.AdminView', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.LienKet_AdminView',
    
    layout: {
        type: 'hbox',
        align: 'stretch',
        padding: 10
    },

    items: [{
            xtype: 'panel',
            margins: '0 0 7 0',
            flex: 2,
            layout: {
                type: 'vbox',
                align: 'stretchmax'
            },
            
            defaults: {
                floating: true,
                style: 'float: right; margin-right: 0; margin-bottom: 15px'
            },
            
            items: []
    }, {
            xtype: 'panel',
            margins: '0 0 7 0',
            flex: 8,
            layout: 'card',
            activeItem: 0,
            items: []
    }], 

    initComponent: function()
    {
        this.callParent(arguments);
        
        var thisComponent = this;

        var column2 = thisComponent.items.get(1);
        var colunm1 = thisComponent.items.get(0);
        
        for(var i = 0; i < 5; i++)
            {
                var panel = Ext.widget('panel', {
                    html: 'Panel ' + i,
                    itemId: 'card-' + i
                });
                
                column2.add(panel);
                
                var button = Ext.widget('button', {
                    text: 'card-' + i,
                    handler: function() {
                        column2.getLayout().setActiveItem(this.getText());
                    }
                });
                
                colunm1.add(button);
            }
    }
});
